package com.itheima.test;

import com.itheima.mapper.WorkMapper;
import com.itheima.pojo.PublishWork;
import com.itheima.pojo.ShowWorks;
import com.itheima.pojo.vo.UserOv;
import com.itheima.pojo.vo.WorkOv;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author 28066
 * @version 1.0
 * @description: TODO
 * @date 2022/11/13 20:02
 */
@SpringBootTest
public class TT0 {
    @Autowired
    private WorkMapper workMapper;
    @Test
    public void t1(){
        PublishWork publishWork = new PublishWork();
        publishWork.setCreatedOn(new Date());
        publishWork.setMemo("狗都不学");
        publishWork.setName("测试");
        publishWork.setType(1);
        publishWork.setUserId(2);
        int i = workMapper.insertNewWork(publishWork);
    }

    @Test
    public void t2(){
        ShowWorks showWorks = new ShowWorks();
        showWorks.setType(1);
        showWorks.setTime(new Date());
        List<UserOv> userOvs = workMapper.selectWorks(showWorks);
        for (UserOv userOv : userOvs) {
            System.out.println(userOv);
        }
    }

    @Test
    public void t3(){
        System.out.println(new Date());
    }
}
